﻿
namespace BAFactory.Fx.FileTags.Exif.IFD
{
    // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html
    public enum IFDTagCode
    {
        ImageWidth = 256,
        ImageLength = 257,
        BitsPerSample = 258,
        Compression = 259,
        PhotometricInterpretation = 262,
        Orientation = 274,
        SamplesPerPixel = 277,
        PlanarConfiguration = 284,
        YCbCrSubSampling = 530,
        YCbCrPositioning = 531,
        XResolution = 282,
        YResolution = 283,
        ResolutionUnit = 296,
        StripOffsets = 273,
        RowsPerStrip = 278,
        StripByteCounts = 279,
        JPEGInterchangeFormat = 513,
        JPEGInterchangeFormatLength = 514,
        TransferFunction = 301,
        WhitePoint = 318,
        PrimaryChromaticities = 319,
        YCbCrCoefficients = 529,
        ReferenceBlackWhite = 532,
        DateTime = 306,
        ImageDescription = 270,
        Make = 271,
        Model = 272,
        Software = 305,
        Artist = 315,
        Copyright = 33432,
        ExifVersion = 36864,
        DateTimeOriginal = 36867,
        DateTimeDigitized = 36868,
        ComponentsConfiguration = 37121,
        CompressedBitsPerPixel = 37122,
        ShutterSpeedValue = 37377,
        ApertureValue = 37378,
        BrightnessValue = 37379,
        ExposureBiasValue = 37380,
        MaxApertureValue = 37381,
        SubjectDistance = 37382,
        MeteringMode = 37383,
        LightSource = 37384,
        Flash = 37385,
        FocalLength = 37386,
        SubjectArea = 37396,
        MakerNote = 37500,
        UserComment = 37510,
        SubSecTime = 37520,
        SubSecTimeOriginal = 37521,
        SubSecTimeDigitized = 37522,
        FlashpixVersion = 40960,
        ColorSpace = 40961,
        PixelXDimension = 40962,
        PixelYDimension = 40963,
        RelatedSoundFile = 40964,
        FlashEnergy = 41483,
        SpatialFrequencyResponse = 41484,
        FocalPlaneXResolution = 41486,
        FocalPlaneYResolution = 41487,
        FocalPlaneResolutionUnit = 41488,
        SubjectLocation = 41492,
        ExposureIndex = 41493,
        SensingMethod = 41495,
        FileSource = 41728,
        SceneType = 41729,
        CFAPattern = 41730,
        CustomRendered = 41985,
        ExposureMode = 41986,
        WhiteBalance = 41987,
        DigitalZoomRatio = 41988,
        FocalLengthIn35mmFilm = 41989,
        SceneCaptureType = 41990,
        GainControl = 41991,
        Contrast = 41992,
        Saturation = 41993,
        Sharpness = 41994,
        DeviceSettingDescription = 41995,
        SubjectDistanceRange = 41996,
        ImageUniqueID = 42016,
        ExposureTime = 33434,
        FNumber = 33437,
        ExposureProgram = 34850,
        SpectralSensitivity = 34852,
        ISOSpeedRatings = 34855,
        OECF = 34856,
        ImageWidth_ = 256,
        ImageLength__ = 257,
        BitsPerSample_ = 258,
        Compression_ = 259,
        PhotometricInterpretation_ = 262,
        Orientation_ = 274,
        SamplesPerPixel_ = 277,
        PlanarConfiguration_ = 284,
        YCbCrSubSampling_ = 530,
        YCbCrPositioning_ = 531,
        XResolution_ = 282,
        YResolution_ = 283,
        ResolutionUnit_ = 296,
        StripOffsets_ = 273,
        RowsPerStrip_ = 278,
        StripByteCounts_ = 279,
        JPEGInterchangeFormat_ = 513,
        JPEGInterchangeFormatLength_ = 514,
        TransferFunction_ = 301,
        WhitePoint_ = 318,
        PrimaryChromaticities_ = 319,
        YCbCrCoefficients_ = 529,
        ReferenceBlackWhite_ = 532,
        DateTime_ = 306,
        ImageDescription_ = 270,
        Make_ = 271,
        Model_ = 272,
        Software_ = 305,
        Artist_ = 315,
        Copyright_ = 33432,
        InteropIndex = 1,
        InteropVersion = 2,
        ProcessingSoftware = 11,
        SubfileType = 254,
        OldSubfileType = 255,
        BitsPerSample__ = 258,
        Compression__ = 259,
        PhotometricInterpretation__ = 262,
        Thresholding = 263,
        CellWidth = 264,
        CellLength = 265,
        FillOrder = 266,
        DocumentName = 269,
        ImageDescription__ = 270,
        Make__ = 271,
        Model__ = 272,
        StripOffsets__ = 273,
        Orientation__ = 274,
        SamplesPerPixel__ = 277,
        RowsPerStrip__ = 278,
        StripByteCounts__ = 279,
        MinSampleValue = 280,
        MaxSampleValue = 281,
        XResolution__ = 282,
        YResolution__ = 283,
        PlanarConfiguration__ = 284,
        PageName = 285,
        XPosition = 286,
        YPosition = 287,
        FreeOffsets = 288,
        FreeByteCounts = 289,
        GrayResponseUnit = 290,
        GrayResponseCurve = 291,
        T4Options = 292,
        T6Options = 293,
        ResolutionUnit__ = 296,
        PageNumber = 297,
        ColorResponseUnit = 300,
        TransferFunction__ = 301,
        Software__ = 305,
        ModifyDate = 306,
        Artist__ = 315,
        HostComputer = 316,
        Predictor = 317,
        WhitePoint__ = 318,
        PrimaryChromaticities__ = 319,
        ColorMap = 320,
        HalftoneHints = 321,
        TileWidth = 322,
        TileLength = 323,
        TileOffsets = 324,
        TileByteCounts = 325,
        BadFaxLines = 326,
        CleanFaxData = 327,
        ConsecutiveBadFaxLines = 328,
        SubIFD = 330,
        InkSet = 332,
        InkNames = 333,
        NumberofInks = 334,
        DotRange = 336,
        TargetPrinter = 337,
        ExtraSamples = 338,
        SampleFormat = 339,
        SMinSampleValue = 340,
        SMaxSampleValue = 341,
        TransferRange = 342,
        ClipPath = 343,
        XClipPathUnits = 344,
        YClipPathUnits = 345,
        Indexed = 346,
        JPEGTables = 347,
        JPEGTables_ = 437,
        OPIProxy = 351,
        GlobalParametersIFD = 400,
        ProfileType = 401,
        FaxProfile = 402,
        CodingMethods = 403,
        VersionYear = 404,
        ModeNumber = 405,
        Decode = 433,
        DefaultImageColor = 434,
        T82Options = 435,
        JPEGProc = 512,
        ThumbnailOffset = 513,
        ThumbnailLength = 514,
        JPEGRestartInterval = 515,
        JPEGLosslessPredictors = 517,
        JPEGPointTransforms = 518,
        JPEGQTables = 519,
        JPEGDCTables = 520,
        JPEGACTables = 521,
        YCbCrCoefficients__ = 529,
        YCbCrSubSampling__ = 530,
        YCbCrPositioning__ = 531,
        ReferenceBlackWhite__ = 532,
        StripRowCounts = 559,
        ApplicationNotes = 700,
        USPTOMiscellaneous = 999,
        RelatedImageFileFormat = 4096,
        RelatedImageWidth = 4097,
        RelatedImageHeight = 4098,
        Rating = 18246,
        XP_DIP_XML = 18247,
        StitchInfo = 18248,
        RatingPercent = 18249,
        ImageID = 32781,
        WangTag1 = 32931,
        WangAnnotation = 32932,
        WangTag3 = 32933,
        WangTag4 = 32934,
        Matteing = 32995,
        DataType = 32996,
        ImageDepth = 32997,
        TileDepth = 32998,
        Model2 = 33405,
        CFARepeatPatternDim = 33421,
        CFAPattern2 = 33422,
        BatteryLevel = 33423,
        KodakIFD = 33424,
        Copyright__ = 33432,
        ExposureTime_ = 33434,
        FNumber_ = 33437,
        MDFileTag = 33445,
        MDScalePixel = 33446,
        MDColorTable = 33447,
        MDLabName = 33448,
        MDSampleInfo = 33449,
        MDPrepDate = 33450,
        MDPrepTime = 33451,
        MDFileUnits = 33452,
        PixelScale = 33550,
        AdventScale = 33589,
        AdventRevision = 33590,
        UIC1Tag = 33628,
        UIC2Tag = 33629,
        UIC3Tag = 33630,
        UIC4Tag = 33631,
        IPTCNAA = 33723,
        IntergraphPacketData = 33918,
        IntergraphFlagRegisters = 33919,
        IntergraphMatrix = 33920,
        INGRReserved = 33921,
        ModelTiePoint = 33922,
        Site = 34016,
        ColorSequence = 34017,
        IT8Header = 34018,
        RasterPadding = 34019,
        BitsPerRunLength = 34020,
        BitsPerExtendedRunLength = 34021,
        ColorTable = 34022,
        ImageColorIndicator = 34023,
        BackgroundColorIndicator = 34024,
        ImageColorValue = 34025,
        BackgroundColorValue = 34026,
        PixelIntensityRange = 34027,
        TransparencyIndicator = 34028,
        ColorCharacterization = 34029,
        HCUsage = 34030,
        TrapIndicator = 34031,
        CMYKEquivalent = 34032,
        SEMInfo = 34118,
        AFCP_IPTC = 34152,
        PixelMagicJBIGOptions = 34232,
        ModelTransform = 34264,
        WB_GRGBLevels = 34306,
        LeafData = 34310,
        PhotoshopSettings = 34377,
        ExifOffset = 34665,
        ICC_Profile = 34675,
        TIFF_FXExtensions = 34687,
        MultiProfiles = 34688,
        SharedData = 34689,
        T88Options = 34690,
        ImageLayer = 34732,
        GeoTiffDirectory = 34735,
        GeoTiffDoubleParams = 34736,
        GeoTiffAsciiParams = 34737,
        ExposureProgram_ = 34850,
        SpectralSensitivity_ = 34852,
        GPSInfo = 34853,
        ISO = 34855,
        OptoElectricConvFactor = 34856,
        Interlace = 34857,
        TimeZoneOffset = 34858,
        SelfTimerMode = 34859,
        SensitivityType = 34864,
        StandardOutputSensitivity = 34865,
        RecommendedExposureIndex = 34866,
        ISOSpeed = 34867,
        ISOSpeedLatitudeyyy = 34868,
        ISOSpeedLatitudezzz = 34869,
        FaxRecvParams = 34908,
        FaxSubAddress = 34909,
        FaxRecvTime = 34910,
        LeafSubIFD = 34954,
        ExifVersion_ = 36864,
        DateTimeOriginal_ = 36867,
        CreateDate = 36868,
        ComponentsConfiguration_ = 37121,
        CompressedBitsPerPixel_ = 37122,
        ShutterSpeedValue_ = 37377,
        ApertureValue_ = 37378,
        BrightnessValue_ = 37379,
        Brightness = 65107,
        ExposureCompensation = 37380,
        MaxApertureValue_ = 37381,
        SubjectDistance_ = 37382,
        MeteringMode_ = 37383,
        LightSource_ = 37384,
        FocalLength_ = 37386,
        FlashEnergy_ = 37387,
        FlashEnergy__ = 41483,
        SpatialFrequencyResponse_ = 37388,
        SpatialFrequencyResponse__ = 41484,
        Noise = 37389,
        Noise_ = 41485,
        FocalPlaneXResolution_ = 37390,
        FocalPlaneXResolution__ = 41486,
        FocalPlaneYResolution_ = 37391,
        FocalPlaneYResolution__ = 41487,
        FocalPlaneResolutionUnit_ = 37392,
        FocalPlaneResolutionUnit__ = 41488,
        ImageNumber_ = 37393,
        ImageNumber__ = 41489,
        SecurityClassification = 37394,
        SecurityClassification_ = 41490,
        ImageHistory = 37395,
        ImageHistory_ = 41491,
        SubjectArea_ = 37396,
        ExposureIndex_ = 37397,
        ExposureIndex__ = 41493,
        TIFFEPStandardID = 37398,
        TIFFEPStandardID_ = 41494,
        SensingMethod_ = 37399,
        SensingMethod__ = 41495,
        CIP3DataFile = 37434,
        CIP3Sheet = 37435,
        CIP3Side = 37436,
        StoNits = 37439,
        MakerNoteCanon = 37500,
        UserComment_ = 37510,
        SubSecTime_ = 37520,
        SubSecTimeOriginal_ = 37521,
        SubSecTimeDigitized_ = 37522,
        MSDocumentText = 37679,
        MSPropertySetStorage = 37680,
        MSDocumentTextPosition = 37681,
        ImageSourceData = 37724,
        XPTitle = 40091,
        XPComment = 40092,
        XPAuthor = 40093,
        XPKeywords = 40094,
        XPSubject = 40095,
        FlashpixVersion_ = 40960,
        ColorSpace_ = 40961,
        ExifImageWidth = 40962,
        ExifImageHeight = 40963,
        RelatedSoundFile_ = 40964,
        InteropOffset = 40965,
        SubjectLocation_ = 41492,
        FileSource_ = 41728,
        SceneType_ = 41729,
        CFAPattern_ = 41730,
        CustomRendered_ = 41985,
        ExposureMode_ = 41986,
        WhiteBalance_ = 41987,
        WhiteBalance__ = 65102,
        DigitalZoomRatio_ = 41988,
        FocalLengthIn35mmFormat = 41989,
        SceneCaptureType_ = 41990,
        GainControl_ = 41991,
        Contrast_ = 41992,
        Contrast__ = 65108,
        Saturation_ = 41993,
        Saturation__ = 65109,
        Sharpness_ = 41994,
        Sharpness__ = 65110,
        DeviceSettingDescription_ = 41995,
        SubjectDistanceRange_ = 41996,
        ImageUniqueID_ = 42016,
        OwnerName = 42032,
        OwnerName_ = 65000,
        SerialNumber = 42033,
        SerialNumber_ = 65001,
        LensInfo = 42034,
        LensMake = 42035,
        LensModel = 42036,
        LensSerialNumber = 42037,
        GDALMetadata = 42112,
        GDALNoData = 42113,
        Gamma = 42240,
        ExpandSoftware = 44992,
        ExpandLens = 44993,
        ExpandFilm = 44994,
        ExpandFilterLens = 44995,
        ExpandScanner = 44996,
        ExpandFlashLamp = 44997,
        PixelFormat = 48129,
        Transformation = 48130,
        Uncompressed = 48131,
        ImageType = 48132,
        ImageWidth__ = 48256,
        ImageHeight = 257,
        ImageHeight_ = 48257,
        WidthResolution = 48258,
        HeightResolution = 48259,
        ImageOffset = 48320,
        ImageByteCount = 48321,
        AlphaOffset = 48322,
        AlphaByteCount = 48323,
        ImageDataDiscard = 48324,
        AlphaDataDiscard = 48325,
        OceScanjobDesc = 50215,
        OceApplicationSelector = 50216,
        OceIDNumber = 50217,
        OceImageLogic = 50218,
        Annotations = 50255,
        PrintIM = 50341,
        USPTOOriginalContentType = 50560,
        DNGVersion = 50706,
        DNGBackwardVersion = 50707,
        UniqueCameraModel = 50708,
        LocalizedCameraModel = 50709,
        CFAPlaneColor = 50710,
        CFALayout = 50711,
        LinearizationTable = 50712,
        BlackLevelRepeatDim = 50713,
        BlackLevel = 50714,
        BlackLevelDeltaH = 50715,
        BlackLevelDeltaV = 50716,
        WhiteLevel = 50717,
        DefaultScale = 50718,
        DefaultCropOrigin = 50719,
        DefaultCropSize = 50720,
        ColorMatrix1 = 50721,
        ColorMatrix2 = 50722,
        CameraCalibration1 = 50723,
        CameraCalibration2 = 50724,
        ReductionMatrix1 = 50725,
        ReductionMatrix2 = 50726,
        AnalogBalance = 50727,
        AsShotNeutral = 50728,
        AsShotWhiteXY = 50729,
        BaselineExposure = 50730,
        BaselineNoise = 50731,
        BaselineSharpness = 50732,
        BayerGreenSplit = 50733,
        LinearResponseLimit = 50734,
        CameraSerialNumber = 50735,
        DNGLensInfo = 50736,
        ChromaBlurRadius = 50737,
        AntiAliasStrength = 50738,
        ShadowScale = 50739,
        SR2Private = 50740,
        MakerNoteSafety = 50741,
        RawImageSegmentation = 50752,
        CalibrationIlluminant1 = 50778,
        CalibrationIlluminant2 = 50779,
        BestQualityScale = 50780,
        RawDataUniqueID = 50781,
        AliasLayerMetadata = 50784,
        OriginalRawFileName = 50827,
        OriginalRawFileData = 50828,
        ActiveArea = 50829,
        MaskedAreas = 50830,
        AsShotICCProfile = 50831,
        AsShotPreProfileMatrix = 50832,
        CurrentICCProfile = 50833,
        CurrentPreProfileMatrix = 50834,
        ColorimetricReference = 50879,
        PanasonicTitle = 50898,
        PanasonicTitle2 = 50899,
        CameraCalibrationSig = 50931,
        ProfileCalibrationSig = 50932,
        ProfileIFD = 50933,
        AsShotProfileName = 50934,
        NoiseReductionApplied = 50935,
        ProfileName = 50936,
        ProfileHueSatMapDims = 50937,
        ProfileHueSatMapData1 = 50938,
        ProfileHueSatMapData2 = 50939,
        ProfileToneCurve = 50940,
        ProfileEmbedPolicy = 50941,
        ProfileCopyright = 50942,
        ForwardMatrix1 = 50964,
        ForwardMatrix2 = 50965,
        PreviewApplicationName = 50966,
        PreviewApplicationVersion = 50967,
        PreviewSettingsName = 50968,
        PreviewSettingsDigest = 50969,
        PreviewColorSpace = 50970,
        PreviewDateTime = 50971,
        RawImageDigest = 50972,
        OriginalRawFileDigest = 50973,
        SubTileBlockSize = 50974,
        RowInterleaveFactor = 50975,
        ProfileLookTableDims = 50981,
        ProfileLookTableData = 50982,
        OpcodeList1 = 51008,
        OpcodeList2 = 51009,
        OpcodeList3 = 51022,
        NoiseProfile = 51041,
        Padding = 59932,
        OffsetSchema = 59933,
        Lens = 65002,
        KDC_IFD = 65024,
        RawFile = 65100,
        Converter = 65101,
        Exposure = 65105,
        Shadows = 65106,
        Smoothness = 65111,
        MoireFilter = 65112
    }

    public enum ExifColorSpace
    {
        sRGB = (int)0x1,
        Adobe_RGB = (int)0x2,
        Wide_Gamut_RGB = (int)0xfffd,
        ICC_Profile = (int)0xfffe,
        Uncalibrated = (int)0xffff
    }

    public enum ExifSubFileType
    {
        FullResolutionImage = (int)0x0,
        ReducedResolutionImage = (int)0x1,
        SinglePageOfMultiPageImage = (int)0x2,
        SinglePageOfMultiPageReducedResolutionImage = (int)0x3,
        TransparencyMask = (int)0x4,
        TransparencyMskOfReducedResolutionImage = (int)0x5,
        TransparencyMaskOfMultiPageImage = (int)0x6,
        TransparencyMaskOfReducedResolutionMultiPage = (int)0x7,

        //0xffffffff = invalid 
        //Bit 0 = Reduced resolution 
        //Bit 1 = Single page 
        //Bit 2 = Transparency mask 
        //Bit 3 = TIFF/IT final page 
        //Bit 4 = TIFF-FX mixed raster content
    }

    public enum ExifOldSubFileType
    {
        FullResolutionImage = 1,
        ReducedResolutionImage = 2,
        SinglePageOfMultiPageImage = 3
    }

    public enum ExifCompression
    {
        Uncompressed = 1,
        CCITT1D = 2,
        T4Group3Fax = 3,
        T6Group4Fax = 4,
        LZW = 5,
        JPEG_OldStyle = 6,
        JPEG = 7,
        AdobeDeflate = 8,
        JBIGBetW = 9,
        JBIGColor = 10,
        JPEG_ = 99,
        Kodak262 = 262,
        Next = 32766,
        SonyARWCompressed = 32767,
        PackedRAW = 32769,
        SamsungSRWCompressed = 32770,
        CCIRLEW = 32771,
        PackBits = 32773,
        Thunderscan = 32809,
        KodakKDCCompressed = 32867,
        IT8CTPAD = 32895,
        IT8LW = 32896,
        IT8MP = 32897,
        IT8BL = 32898,
        PixarFilm = 32908,
        PixarLog = 32909,
        Deflate = 32946,
        DCS = 32947,
        JBIG = 34661,
        SGILog = 34676,
        SGILog24 = 34677,
        JPEG2000 = 34712,
        NikonNEFCompressed = 34713,
        JBIG2TIFFFX = 34715,
        MicrosoftDocumentImaging_MDI_BinaryLevelCodec = 34718,
        MicrosoftDocumentImaging_MDI_ProgressiveTransformCodec = 34719,
        MicrosoftDocumentImaging_MDI_Vector = 34720,
        KodakDCRCompressed = 65000,
        PentaxPEFCompressed = 65535
    }

    public enum ExifPhotometricInterpretation
    {
        WhiteIsZero = 0,
        BlackIsZero = 1,
        RGB = 2,
        RGBPalette = 3,
        TransparencyMask = 4,
        CMYK = 5,
        YCbCr = 6,
        CIELab = 8,
        ICCLab = 9,
        ITULab = 10,
        ColorFilterArray = 32803,
        PixarLogL = 32844,
        PixarLogLuv = 32845,
        LinearRaw = 34892,
    }

    public enum ExifThresholding
    {
        NoDitheringOrHalftoning = 1,
        OrderedDitherOrHalftone = 2,
        RandomizedDither = 3
    }

    public enum ExifFlash
    {
        NoFlash = (int)0x0,
        Fired = (int)0x1,
        FiredReturnNotDetected = (int)0x5,
        FiredReturnDetected = (int)0x7,
        OnDidNotFire = (int)0x8,
        OnFired = (int)0x9,
        OnReturnNotDetected = (int)0xd,
        OnReturnDetected = (int)0xf,
        OffDidNotFire = (int)0x10,
        OffDidNotFireReturnNotDetected = (int)0x14,
        AutoDidNotFire = (int)0x18,
        AutoFired = (int)0x19,
        AutoFiredReturnNotDetected = (int)0x1d,
        AutoFiredReturnDetected = (int)0x1f,
        NoFlashFunction = (int)0x20,
        OffNoFlashFunction = (int)0x30,
        FiredRedEyeReduction = (int)0x41,
        FiredRedEyeReductionReturnNotDetected = (int)0x45,
        FiredRedEyeReductionReturnDetected = (int)0x47,
        OnRedEyeReduction = (int)0x49,
        OnRedEyeReductionReturnNotDetected = (int)0x4d,
        OnRedEyeReductionReturnDetected = (int)0x4f,
        OffRedEyeReduction = (int)0x50,
        AutoDidNotFireRedEyeReduction = (int)0x58,
        AutoFiredRedEyeReduction = (int)0x59,
        AutoFiredRedEyeReductionReturnNotDetected = (int)0x5d,
        AutoFiredRedEyeReductionReturnDetected = (int)0x5f
    }
}
